package MOLE;

/** 
 Class1 ��ժҪ˵����
*/
public class SQL_SqlStr
{


	private String pre = " INSERT INTO ";
	//		   (txt) VALUES (   @txt  )";
	private String cols = "";
	private String mid = ") VALUES (";
	private String values = "";
	private String end = ")";

	public SQL_SqlStr(String TableName)
	{
		//
		// TODO: �ڴ˴���ӹ��캯���߼�
		//
		pre = pre + TableName + "(";
	}

	public final void Add(String columename, Object o)
	{
		cols += columename + ",";
		if (o.getClass().toString().equals("System.Int32") || o.getClass().toString().equals("System.Decimal") || o.getClass().toString().equals("System.Double"))
		{
			values += o + ",";
		}

		else //System.String
		{
			 values += "'" + o + "'" + ",";
		}

	}

	public final String GetAddSql()
	{
		cols = cols.substring(0,cols.length() - 1);
		values = values.substring(0,values.length() - 1);
		String s = pre + cols + mid + values + end;
		return s;

	}

}